var events = require("events");
var Emitter = events.EventEmitter;
function Dog(dogName)
{
    Emitter.call(this);//this指向Dog
    this.dogName = dogName;
}

Dog.prototype = Emitter.prototype;//希望Dog继承Emitter
(Dog.prototype).bark = function(){
    console.log(this.dogName + "bark");
}

//引用此模块
module.exports = Dog;//把Dog这个构造函数公布出去